using Framework.Audio;
using Framework.FSMLite;
using Framework.GamePool;
using Framework.UI;
using UnityEngine;
using View;

namespace GameSystem
{
    public class StateHome: StateMachine<GameEnum>
    {

        private GamePoolObject Homeobj;

        internal override void OnEnter(params object[] args)
        {
            GameManager.Instance.GameRoom.ClearScene();
            Homeobj = GamePoolMgr.Instance.InstantiatePoolObject<GamePoolObject>("HomeObject", Vector3.zero);
            GameManager.Instance.ChangeVCam(5);
            AudioManager.Instance.PlayBGM("BGM_2" , 1 , 2F);
            UIManager.Instance.OpenView(UIPanel.HomePanel);
        }
        internal override void OnExit()
        {
            UIManager.Instance.CloseView(UIPanel.HomePanel);
            this.Homeobj.Pool_Disable();
        }
    }
}